<ui:composition
		xmlns="http://www.w3.org/1999/xhtml"
		xmlns:h="http://java.sun.com/jsf/html"
		xmlns:f="http://java.sun.com/jsf/core"
		xmlns:a4j="http://richfaces.org/a4j"
		xmlns:rich="http://richfaces.org/rich"
		xmlns:ui="http://java.sun.com/jsf/facelets"
		>
	<f:loadBundle basename="bundle.common" var="commonBundle"/>


	<ui:insert name="beforeTable"/>
	<a4j:form id="addForm" rendered="#{showAddLink}">
		<a4j:commandLink value="#{commonBundle.add}" action="#{actionBean.add}" reRender="#{idPrefix}TablePanel"/>
	</a4j:form>

	<rich:panel id="#{idPrefix}TablePanel" styleClass="transparent">
		<a4j:form>
			<ui:insert name="selected"/>
			<table width="100%">
				<tr>
					<td width="15%">&#160;</td>
					<td width="70%">
						<rich:datascroller for="#{idPrefix}Table" reRender="#{idPrefix}TablePanel"
										   page="#{actionBean.currentPage}" renderIfSinglePage="false"/>
					</td>
					<td width="15%">
						<h:selectOneMenu value="#{actionBean.resultsPerPage}"
										 rendered="#{actionBean.resultsPerPageLookupVisible}">
							<f:selectItems value="#{actionBean.resultsPerPageLookup}"/>
							<a4j:support event="onchange" reRender="#{idPrefix}TablePanel" ajaxSingle="true"/>
						</h:selectOneMenu>
					</td>
				</tr>
				<tr>
					<td colspan="3">
						<rich:dataTable id="#{idPrefix}Table" width="100%" headerClass="dr-table-header"
										onRowMouseOver="this.style.backgroundColor='#f1f1f1';"
										onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}';"
										var="record" value="#{actionBean.dataModel}"
										binding="#{actionBean.tableBinding}" rows="#{actionBean.resultsPerPage}"
										columns="#{colNum}">
							<ui:insert name="tableContext"/>
						</rich:dataTable>
					</td>
				</tr>
				<tr>
					<td width="15%">&#160;</td>
					<td width="70%">
						<rich:datascroller for="#{idPrefix}Table" reRender="#{idPrefix}TablePanel"
										   page="#{actionBean.currentPage}" renderIfSinglePage="false"/>
					</td>
					<td width="15%">
						<h:selectOneMenu value="#{actionBean.resultsPerPage}"
										 rendered="#{actionBean.resultsPerPageLookupVisible}">
							<f:selectItems value="#{actionBean.resultsPerPageLookup}"/>
							<a4j:support event="onchange" reRender="#{idPrefix}TablePanel" ajaxSingle="true"/>
						</h:selectOneMenu>
					</td>
				</tr>
			</table>
		</a4j:form>
	</rich:panel>

</ui:composition>